import _ from 'lodash';
import printMe from '../assets/js/print.js';

function component() {
	let element = document.createElement('div');
	let p = document.createElement('p');
	let p2 = document.createElement('p');
	
	// Lodash, now imported by this script
	element.innerHTML = _.join(['Hello', 'webpack', 'watch']);
	p.innerHTML = 'webpack-dev-middleware中间件, webpack-hot-middleware'
	p2.innerHTML = 'webpack-dev-middleware配合express及webpack-hot-middleware'
	element.appendChild(p);
	element.appendChild(p2);
	
	// 创建按钮
	let btn = document.createElement('button');
	btn.innerHTML = 'Click me and check the console!';
   	btn.onclick = printMe;
	
   	element.appendChild(btn);
	return element;
}

document.body.appendChild(component());